// components/epsoide/index.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    index: {
      type: Number,
      observer(newVal) {
        let val = newVal < 10 ? "0" + newVal : newVal.toString()
        this.setData({
          _index: val
        })
      }
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    year: 0,
    month: "",
    months: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
    _index: ""
  },
  /**
   * 组件生命周期声明对象
   */
  lifetimes: {
    /**
     * 在组件实例进入页面节点树时执行
     */
    attached() {
      let date = new Date();
      let year = date.getFullYear();
      let month = date.getMonth();
      this.setData({
        year: year,
        month: this.data.months[month]
      })
    }
  },
  /**
   * 组件的方法列表
   */
  methods: {

  }
})
